package com.cetcs.kmga.dataView.entity.dataManager.vo;

import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

/**
 * 圆形统计图格式
 *
 * @author yyangs
 * @version V1.0 创建时间：2017-10-10 11:14
 * Copyright 2017 by CETC
 */
public class CircularChartVo {

    /**
     * 统计图标题
     */
    private String name;

    /**
     * 整个圆形统计图所有的子版块名称
     */
    private Set<String> legendData = new HashSet<>();

    /**
     * 数据
     */
    private List<CircularPartFormat> datas = new LinkedList<>();

    /**
     * 添加一个子版块
     * @param name 板块名称
     * @param value 板块值
     */
    public void addData(String name,double value,String id){
        CircularPartFormat part = new CircularPartFormat();
        part.name = name;
        part.value = value;
        part.id = id;
        legendData.add(name);
        datas.add(part);
    }

    /**
     * 圆形统计部部分子版块格式对象
     */
    public static class CircularPartFormat{

        //板块名称,legendData必须包含
        private String name;

        //板块值,不是百分百
        private double value;

        //id
        private String id;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public double getValue() {
            return value;
        }

        public void setValue(double value) {
            this.value = value;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Set<String> getLegendData() {
        return legendData;
    }

    public void setLegendData(Set<String> legendData) {
        this.legendData = legendData;
    }

    public List<CircularPartFormat> getDatas() {
        return datas;
    }

    public void setDatas(List<CircularPartFormat> datas) {
        this.datas = datas;
    }



}
